package com.org.javabody.StaticApi.StaticDemo;

/**
 * Created by Administrator on 2017-03-30.
 */
public class StaticDemo {
    private StaticDemo(){};
    private static StaticDemo INSTANCE = new StaticDemo();
    public static StaticDemo getINSTANCE(){
        return  INSTANCE;
    }
    public static int value = -1;
    public void addValue(){
        value++;
        System.out.println(value);
    }
    public void subValue(){
        value--;
        System.out.println(value);
    }

    public static void main(String[] args) {
        System.out.println(value);
        StaticDemo.getINSTANCE().addValue();
        StaticDemo.getINSTANCE().addValue();
        StaticDemo.getINSTANCE().addValue();
        StaticDemo.getINSTANCE().addValue();
        StaticDemo.getINSTANCE().addValue();
        StaticDemo.getINSTANCE().subValue();
        StaticDemo.getINSTANCE().addValue();
        StaticDemo.getINSTANCE().addValue();
        StaticDemo.getINSTANCE().subValue();
    }
}
